package com.zhny.sensor.service;

import com.zhny.sensor.dao.BarcodeMachineStatusRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * @Auther: zhy
 * @Date: 2019/11/23
 * @Description: 脚标机状态更新服务
 */
@Service
@Transactional
public class BarcodeMachineStatusService {

    @Autowired
    private BarcodeMachineStatusRepository barcodeMachineStatusRepository;


    /**
     * 更新脚标机状态
     *
     * @param barcodeMachineId 脚标机编号
     * @param state 状态
     * @param barcodeSurplus   条码剩余量
     * @return
     */
    public int updateBarcodeMachineStatus(String barcodeMachineId, String state, Integer barcodeSurplus) {
        return barcodeMachineStatusRepository.updateBarcodeMachineStatus(state,barcodeSurplus,barcodeMachineId);
    }

}
